package com.onesports.intelligent.k12.polarlight.service.course;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.onesports.intelligent.k12.polarlight.domain.entity.course.CourseScheduleDetailCoachRel;
import com.onesports.intelligent.k12.polarlight.mapper.course.ScheduleDetailCoachRelMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Wsy
 **/
@Service
public class ScheduleDetailCoachRelService extends ServiceImpl<ScheduleDetailCoachRelMapper, CourseScheduleDetailCoachRel> {

    /**
     * 根据课表详情id删除教练关联信息
     *
     * @param scheduleDetailIds 课表详情ids
     */
    public void removeByScheduleDetailIds(List<String> scheduleDetailIds) {
        this.remove(new LambdaQueryWrapper<CourseScheduleDetailCoachRel>()
                .in(CourseScheduleDetailCoachRel::getScheduleDetailId, scheduleDetailIds));
    }

    public List<CourseScheduleDetailCoachRel> getByScheduleDetailIds(List<String> scheduleDetailIds) {
        return this.list(new LambdaQueryWrapper<CourseScheduleDetailCoachRel>()
                .in(CourseScheduleDetailCoachRel::getScheduleDetailId, scheduleDetailIds));
    }
}
